package com.yihu.wlyy.repository;

import com.yihu.wlyy.entity.WlyyQuotaResult;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Administrator on 2016/8/16.
 */
public interface WlyyQuotaResultDao extends PagingAndSortingRepository<WlyyQuotaResult, String>, JpaSpecificationExecutor<WlyyQuotaResult> {
    @Query(" FROM WlyyQuotaResult a WHERE a.quotaDate =?1 and a.quatoCode=?2")
    List<WlyyQuotaResult> findByYesterday(String yesterday, String quatoCode);

    @Modifying
    @Query(" delete FROM WlyyQuotaResult a WHERE a.quotaDate =?1 and a.quatoCode=?2")
    void deleteByDateAndCode(String yesterday, String quatoCode);
}
